package com.xja.service.impl;

/*import org.springframework.stereotype.Service;*/
import javax.annotation.Resource;

import com.xja.entity.ContentType;
import com.xja.entity.CourseInfo;
import com.xja.mapper.CourseInfoMapper;
import com.xja.service.CourseInfoService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class CourseInfoServiceImpl implements CourseInfoService{

    @Autowired
    private CourseInfoMapper courseInfoMapper;

    @Override
    public int deleteByPrimaryKey(Integer cid) {
        return courseInfoMapper.deleteByPrimaryKey(cid);
    }

    @Override
    public int insert(CourseInfo record) {
        return courseInfoMapper.insert(record);
    }

    @Override
    public int insertSelective(CourseInfo record) {
        return courseInfoMapper.insertSelective(record);
    }

    @Override
    public CourseInfo selectByPrimaryKey(Integer cid) {
        return courseInfoMapper.selectByPrimaryKey(cid);
    }

    @Override
    public int updateByPrimaryKeySelective(CourseInfo record) {
        return courseInfoMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(CourseInfo record) {
        return courseInfoMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<CourseInfo> getCourses() {
        return courseInfoMapper.getCourses();
    }

    @Override
    public boolean addCourse(CourseInfo courseInfo) {
        int row = courseInfoMapper.addCourse(courseInfo);
        if(row>0){
            return true;
        }
        return false;
    }

    @Override
    public CourseInfo getCourseById(Integer cid) {
        return courseInfoMapper.getCourseById(cid);
    }

    @Override
    public List<ContentType> getCourseType() {
        return courseInfoMapper.getCourseType();
    }

    @Override
    public void updateStatus() {
        courseInfoMapper.updateStatus();
    }

}
